<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xml:lang="en" lang="en">
	
	<h:head>
	<script src="js/jquery-1.4.2.min.js"></script>
	<script>
   $(document).ready(function(){
    document.getElementById("form:summary").value="";
    });
   </script>
   <style>
   li span{
    font-size:15px;
   }
   </style>
	</h:head>
	<body>
		<p>
			<h:form id="form">
			 <div>
			<h:inputTextarea rows="5" cols="145" id="summary" value="#{addcommentinfo.commentcontent}" />
							<br />
				  <div id="but" style="margin: 10px 24px 10px 10px;float:right;">
			 <a4j:commandLink render="table1" action="#{addcommentinfo.initaddComment}" >
							<input type="button" value="评论" onclick="window.location.reload();"/>	
							<a4j:param name="commentid" value="${commentBean.commentid}"
										assignTo="#{addcommentinfo.commentid}" />
			 </a4j:commandLink>
			     </div>
			</div>
				</h:form>
				<rich:dataTable value="#{commentBean.comList}" var="doc" id="table"
					rows="15" width="800" styleClass="tableStyle">
					<f:facet name="header">
							<h:outputText value="评论列表" />
							(<h:outputText value="#{commentBean.row}"></h:outputText>)
						</f:facet>
					<rich:column width="200">
			<ul style="list-style: none;padding-left:10px;display:block;height:50px;width:720px; ">
			  <li>
			  <span style="color:blue;">
			   <h:outputText value="#{doc.commentuser}" />:
			  </span>
			  <span>
			    <h:outputText value="#{doc.commentcontent}" />
			  </span>
			  </li>
			  <div style="clear: both;"></div>
			  <li>
			  <span style="float: right;color:blue;margin-top: 20px;">
			   <h:outputText value="#{doc.commenttime}" >
			   <f:convertDateTime pattern="yyyy-MM-dd HH:MM:SS"/>
			   </h:outputText>
			   </span>
			  </li>
			</ul>
					</rich:column>
					</rich:dataTable>
		</p>
	</body>
</html>
